Make sorts even more stable.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 28 Jul 2005 15:32:49 +0000 (15:32 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 28 Jul 2005 15:32:49 +0000 (15:32 +0000)
gpsbabel/tomtom.c

index 1a314a196bc8ed44fa13ed366dfeace8a6be35e0..5fd2022d327eff73dbffd6f050a29ffbaaac846a 100644 (file)
@@ -143,8 +143,8 @@ compare_lat(const void *a, const void *b)
        if ( difference ) {
                return 1;
        }
-       if ( wa->wpt->longitude - wa->wpt->longitude == 0 ) {
-               return 0;
+       if ( wa->wpt->longitude - wb->wpt->longitude == 0 ) {
+               return strcmp(wa->wpt->shortname, wb->wpt->shortname);
        }
        return compare_lon(a,b);
 }
@@ -163,8 +163,8 @@ compare_lon(const void *a, const void *b)
        if ( difference ) {
                return 1;
        }
-       if ( wa->wpt->latitude - wa->wpt->latitude == 0 ) {
-               return 0;
+       if ( wa->wpt->latitude - wb->wpt->latitude == 0 ) {
+               return strcmp(wa->wpt->shortname, wb->wpt->shortname);
        }
        return compare_lat(a,b);
 }